package com.hhkj.study.admin.user.mapper;

import com.hhkj.study.admin.user.entity.UserListen;
import com.hhkj.study.admin.user.entity.UserListenGroupPo;
import com.hhkj.study.admin.user.model.podo.*;
import com.hhkj.study.admin.user.model.res.UserStatisticExcelRes;
import com.ruoyi.common.base.biz.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
*
* @author SERVER
* @since 2024-09-06
*/
@Mapper
public interface UserListenMapper extends BaseMapper<UserListen, UserListenDo, UserListenPo> {

    /**
     * 查询用户下订单听课记录 订单和课程分组
     * @param userId
     * @param orderItemIdList
     * @param listeningStatus
     * @return
     */
    List<UserListenGroupPo> listGroupByOrderItem(@Param("userId") Long userId, @Param("orderItemIdList") List<Long> orderItemIdList, @Param("listeningStatus") Integer listeningStatus);

    /**
     * 查询用户下订单听课记录 课程和视频分组
     * @return
     */
    List<UserStatisticPo> countUserStudyByCondition(@Param("userStatisticDo") UserStatisticDo userStatisticDo);


    /**
     * 查询用户下订单详细听课记录
     * @param userStatisticExportDo
     * @return
     */
    List<UserStatisticExcelRes> countUserStudyDetail(@Param("conditionDo") UserStatisticExportDo userStatisticExportDo);
}
